package com.xijia.wuyouwallet.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.xijia.wuyouwallet.MyApp;
import com.xijia.wuyouwallet.R;
import com.xijia.wuyouwallet.base.BaseActivity;

/**
 * Created by Administrator on 2017/8/24 0024.
 */

public class AddcardSuccessActivity extends BaseActivity implements View.OnClickListener{

    private ImageView addBankcard_back;
    private TextView addCardSuccess_name,addCardSuccess_bankNum,addCardSuccess_bankType,addCardSuccess_phone,addCardSuccess_config;

    private String bankNum,bankType,phone;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_addcard_success);
        initView();
    }

    private void initView(){
        addBankcard_back = (ImageView) findViewById(R.id.addBankcard_back);
        addBankcard_back.setOnClickListener(this);
        addCardSuccess_name = (TextView) findViewById(R.id.addCardSuccess_name);
        addCardSuccess_bankNum = (TextView) findViewById(R.id.addCardSuccess_bankNum);
        addCardSuccess_bankType = (TextView) findViewById(R.id.addCardSuccess_bankType);
        addCardSuccess_phone = (TextView) findViewById(R.id.addCardSuccess_phone);
        addCardSuccess_config = (TextView) findViewById(R.id.addCardSuccess_config);
        addCardSuccess_config.setOnClickListener(this);

        bankNum = getIntent().getStringExtra("bankNum");
        bankType = getIntent().getStringExtra("bankType");
        phone = getIntent().getStringExtra("phone");

        addCardSuccess_name.setText(MyApp.userData.getData().getNick_name());
        addCardSuccess_bankNum.setText(bankNum);
        if (bankType.equals("1")){
            addCardSuccess_bankType.setText("储蓄卡");
        }else if (bankType.equals("0")){
            addCardSuccess_bankType.setText("信用卡");
        }
        addCardSuccess_phone.setText(phone);
        MyApp.isCard = true;
        MyApp.isChoiseCard = true;
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.addBankcard_back:
                finish();
                break;
            case R.id.addCardSuccess_config:
                finish();
                break;
        }
    }
}
